import Vue from 'vue';
import Vuex from 'vuex';
import persist from 'vuex-persistedstate';

Vue.use(Vuex);

export default new Vuex.Store({
	state: {
		token: '',
		showLoading: false
	},
	getters: {
		getToken(state) {
			return state.token;
		},
		getShowLoading(state) {
			return state.showLoading;
		}
	},
	mutations: {
		setToken(state, data) {
			state.token = data;
		},
		setShowLoading(state, flag) {
			state.showLoading = flag;
		}
	},
	actions: {},
	modules: {},
	plugins: [persist()]
});
